package lcr;

public class Test0136 {
}


class Solution0136_1 {
    public ListNode deleteNode(ListNode head, int val) {
        ListNode ans = new ListNode();
        ans.next = head;
        ListNode now = ans;
        while (now!= null) {
            while (now.next!=null&&now.next.val==val){
                now.next = now.next.next;
            }
            now = now.next;
        }

        return ans.next;
    }
}